#include "TwoWayRotationPieceModel.h"

TwoWayRotationPieceModel::TwoWayRotationPieceModel(const Position& position)
        : PieceModel(position), isRotated(false), newIsRotated(false)
{
}

void TwoWayRotationPieceModel::rotateCW()
{
    isRotated ? (PieceModel::rotateCW()) : (PieceModel::rotateCCW());
    newIsRotated = !isRotated;
}

void TwoWayRotationPieceModel::updateClients()
{
    isRotated = newIsRotated;
    PieceModel::updateClients();
}

void TwoWayRotationPieceModel::rotateCCW()
{
    rotateCW();
}

TwoWayRotationPieceModel::~TwoWayRotationPieceModel()
{
}

void TwoWayRotationPieceModel::reset()
{
    newIsRotated = isRotated;
    PieceModel::reset();
}
